﻿@model MyUrnaVirtual.Models.AdminPersonasViewModel
@{
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<br/>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />

<table class="pure-table" style="color:white;">
    <thead>
        <tr>
            <th style="color:darkblue;">
               Dni
                @Html.DisplayFor(x => x.Dni)
            </th>

            <th style="color: darkred;">
                Nombre
                @Html.DisplayFor(x => x.Nombre)
            </th>

            <th style="color: darkred;">
                Apellido
                @Html.DisplayFor(x => x.Apellido)
            </th>

            <th style="color: darkred;">
                Voto?
                @Html.DisplayFor(x => x.VotoRealizado)
            </th>

        </tr>
    </thead>
    <tbody>
        @using (var db = new MyUrnaVirtual.dbContext())
        {
            foreach (var pers in db.Personas)
            {
                <tr style="color:darkblue;">
                    <td>
                        @pers.nombre
                    </td>
                    <td>
                        @pers.apellido
                    </td>
                    <td>
                        <button class="pure-button pure-button-primary" onclick="window.location.href='/AdminPersonas/Editar?dni=@pers.dni'">Editar</button>
                        <button class="pure-button pure-button-error" onclick="window.location.href='/AdminPersonas/Eliminar?dni=@pers.dni'">Eliminar</button>
                    </td>
                </tr>
            }
        }
    </tbody>
    
</table>
<div align="center">
    <button class="pure-button pure-button-success" onclick="window.location.href='/AdminPersonas/Crear'">Crear</button>

</div>